//
//  BuyFromWorldCollectionViewCell.m
//  GouWoAi
//
//  Created by 赵佟越 on 16/5/5.
//  Copyright © 2016年 zhaotongyue. All rights reserved.
//

#import "BuyFromWorldCollectionViewCell.h"

@implementation BuyFromWorldCollectionViewCell

#pragma  mark - 初始化
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imgView = [[UIImageView alloc]init];
        self.imgView.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:self.imgView];

        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.backgroundColor = [UIColor grayColor];
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:self.titleLabel];

        
        self.detailLabel = [[UILabel alloc] init];
        self.detailLabel.backgroundColor = [UIColor blackColor];
        self.detailLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:self.detailLabel];

        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    NSLog(@"%@",NSStringFromCGSize(layoutAttributes.bounds.size));
    
    // 图片
    self.imgView.frame = CGRectMake(0, 0, layoutAttributes.size.width, 160);
    // 标题
    self.titleLabel.frame = CGRectMake(0, 0, 100, 30);
    self.detailLabel.frame = CGRectMake(0, 190, layoutAttributes.size.width, 20);
    
}

@end
